<!--
 *  ┌───┐   ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐
 *  │Esc│   │ F1│ F2│ F3│ F4│ │ F5│ F6│ F7│ F8│ │ F9│F10│F11│F12│ │P/S│S L│P/B│  ┌┐    ┌┐    ┌┐
 *  └───┘   └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘  └┘    └┘    └┘
 *  ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ ┌───┬───┬───┬───┐
 *  │~ `│! 1│@ 2│# 3│$ 4│% 5│^ 6│& 7│* 8│( 9│) 0│_ -│+ =│ BacSp │ │Ins│Hom│PUp│ │N L│ / │ * │ - │
 *  ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ ├───┼───┼───┼───┤
 *  │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │{ [│} ]│ | \ │ │Del│End│PDn│ │ 7 │ 8 │ 9 │   │
 *  ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ ├───┼───┼───┤ + │
 *  │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │: ;│" '│ Enter  │               │ 4 │ 5 │ 6 │   │
 *  ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤     ┌───┐     ├───┼───┼───┼───┤
 *  │ Shift  │ Z │ X │ C │ V │ B │ N │ M │< ,│> .│? /│  Shift   │     │ ↑ │     │ 1 │ 2 │ 3 │   │
 *  ├─────┬──┴─┬─┴──┬┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ ┌───┼───┼───┐ ├───┴───┼───┤ E││
 *  │ Ctrl│    │Alt │         Space         │ Alt│    │    │Ctrl│ │ ← │ ↓ │ → │ │   0   │ . │←─┘│
 *  └─────┴────┴────┴───────────────────────┴────┴────┴────┴────┘ └───┴───┴───┘ └───────┴───┴───┘
 *
 * @Descripttion:
 * @version:
 * @Date: 2022-03-18 18:01:13
 * @LastEditors: huzhushan@126.com
 * @LastEditTime: 2022-03-19 15:55:20
 * @Author: huzhushan@126.com
 * @HomePage: https://huzhushan.gitee.io/vue3-element-admin
 * @Github: https://github.com/huzhushan/vue3-element-admin
 * @Donate: https://huzhushan.gitee.io/vue3-element-admin/donate/
 -->
<template>
  <div class="app-container">
    <el-input
      v-model="model.name"
      placeholder="输入产品名称搜索"
      class="input-field"
    >
      <el-button slot="append" type="primary" icon="el-icon-search"></el-button>
    </el-input>
    <dl v-for="(field, index) in buttonList" :key="index" class="button-field">
      <dt>{{ field.title }}：</dt>
      <dd
        v-for="(item, i) in field.children"
        :key="i"
        :class="{ checked: item.checked }"
        @click="item.checked = !item.checked"
      >
        {{ item.title }}
        <i v-if="item.checked" class="el-icon-error"></i>
      </dd>
    </dl>
    <ul class="product-list">
      <li
        v-for="item in productList"
        :key="item.id"
        @click="$router.push(`/account/shopping/product/${item.id}`)"
      >
        <div class="img"><img :src="item.img" /></div>
        <div class="title">{{ item.title }}</div>
        <div class="desc">{{ item.desc }}</div>
        <div class="price">
          <span>￥</span>
          {{ item.price }}
        </div>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  name: 'Shopping',
  data() {
    return {
      model: {
        name: '',
      },
      buttonList: [
        {
          title: '5G消息',
          children: [
            {
              title: '文本消息',
              checked: false,
            },
            {
              title: '多媒体消息',
              checked: false,
            },
            {
              title: '卡片消息',
              checked: false,
            },
            {
              title: '卡片轮播图',
              checked: false,
            },
            {
              title: '会话消息',
              checked: false,
            },
          ],
        },
        {
          title: '产品功能',
          children: [
            {
              title: '行业模板',
              checked: false,
            },
            {
              title: '机器人',
              checked: false,
            },
            {
              title: '消息平台',
              checked: false,
            },
            {
              title: 'H5',
              checked: false,
            },
            {
              title: '报表',
              checked: false,
            },
            {
              title: '存储资源',
              checked: false,
            },
          ],
        },
        {
          title: '能力调用',
          children: [
            {
              title: '身份证识别',
              checked: false,
            },
            {
              title: '行驶证识别',
              checked: false,
            },
            {
              title: '图像识别',
              checked: false,
            },
            {
              title: '语音识别',
              checked: false,
            },
            {
              title: 'AI审核',
              checked: false,
            },
          ],
        },
        {
          title: '通话呼叫',
          children: [
            {
              title: '语音通话',
              checked: false,
            },
            {
              title: '高清视频通话',
              checked: false,
            },
            {
              title: '全高清视频通话',
              checked: false,
            },
          ],
        },
      ],
      productList: [
        {
          id: 1,
          img: 'https://fontdo-rcs.oss-cn-shenzhen.aliyuncs.com/76ee3de97a1b8b903319b7c013d8c877/passport/user/identity/43ba9dae42ac46529068f3388a3113af.jpeg',
          title: 'AI审核',
          desc: 'AI审核，可对文本、语音、图片、视频、文章等内容进行自动审核， 节省人工审核成本，提升审核效力，按次收费，10000次,15元',
          price: 20,
        },
        {
          id: 2,
          img: 'https://fontdo-rcs.oss-cn-shenzhen.aliyuncs.com/76ee3de97a1b8b903319b7c013d8c877/passport/user/identity/d8dcf892a5df410a912c3212a83de90a.jpeg',
          title: '身份证识别能力',
          desc: '根据用户上传的身份证图片，识别出用户的身份证号码',
          price: 0.5,
        },
      ],
    }
  },
  methods: {},
}
</script>
<style lang="scss" scoped>
.input-field {
  width: 560px;
  .el-button {
    width: 56px;
    color: #fff;
    background: $primary;
    border: 1px solid $primary;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
}
.button-field {
  margin: 0;
  padding: 20px 0 20px 90px;
  border-bottom: 1px dashed #f0f0f0;
  font-size: 14px;
  &:nth-last-of-type(1) {
    border: none;
  }
  dt {
    margin: 0;
    line-height: 24px;
    float: left;
    margin-left: -90px;
    font-weight: bold;
  }
  dd {
    display: inline-block;
    margin: 0 8px 0 0;
    padding: 4px 20px 4px 6px;
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    &:hover {
      color: $primary;
    }
    &.checked {
      background: $primary;
      color: #fff;
    }
    .el-icon-error {
      position: absolute;
      right: 4px;
      top: 5px;
    }
  }
}
.product-list {
  margin: 0 -10px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  li {
    list-style: none;
    width: 240px;
    padding: 20px;
    margin: 10px;
    box-sizing: border-box;
    border: 1px solid #f0f0f0;
    font-size: 14px;
    cursor: pointer;
    &:hover {
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
    .img {
      height: 160px;
      text-align: center;
      img {
        max-width: 100%;
        max-height: 100%;
      }
    }
    .title {
      margin: 10px 0;
      font-size: 16px;
    }
    .desc {
      height: 64px;
      line-height: 1.5;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 3;
      overflow: hidden;
      color: #999;
    }
    .price {
      margin-top: 20px;
      font-size: 20px;
      color: red;
      span {
        font-size: 14px;
      }
    }
  }
}
</style>
